Copyright: Copyright ® M N Summerfield 1995


 ugrep

ugrep is a program which allows you to search files for a particular search string. ugrep can search recursively through subdirectories and supports very simple regular expressions. Alternatively, ugrep can be used to extract Unix style version information from files, or to extract HTML titles from files.

Using ugrep

Regular Expressions

Unix Style Version Information

HTML Titles

ugrep.ini

Installation

Licence

Version 1.31  15 October, 1995


Using ugrep

To use ugrep, choose a drive, directory and file specification using the controls supplied in the standard way. Now enter a search string which may include a regular expression. Press Go to initiate the search. The names of any files where the search string is found are listed in the Matching files list box.

A search may be stopped at any time by pressing Cancel or [ESC].

File Spec. File specifications can be single, e.g. "*.txt", or multiple, (separated by semi-colons), e.g. "*.txt;*.ini", or "*.bat;*.com;*.exe".

Earliest Date. If you enter a valid date here, only files with a date equal to or greater than this date will be searched.

Pressing Copy list will copy any filenames in the Matches list to the clipboard.

If the Subdirs check box is checked files in any subdirectories will also be searched.

Programs, i.e. files ending .BAT, .COM, or .EXE can be run by double-clicking them or moving to them and pressing [RETURN].

Double-clicking other files will normally have no effect. However, you may specify a filename on the command line, e.g.

C:\PD\UGREP.EXE C:\PD\PFE.EXE

which will cause ugrep to  execute the specified filename with the selected filename as its parameter. Thus if your command line, (set in Program Manager), is:

C:\PD\UGREP.EXE C:\WINDOWS\NOTEPAD.EXE

and you double-click a file in the Matches list called WIN.TXT, ugrep will execute:

C:\WINDOWS\NOTEPAD.EXE WIN.TXT

causing notepad to be launched with WIN.TXT as its file.


Regular Expressions

To search for a string simply enter that string. ugrep permits the following simple regular expression operators:

?	Any single character.

*	Zero or more characters.

#	Any single digit (0 to 9)

[<chars>]	Any single character in <chars>

[!<chars>]	Any single character not in <chars>

Examples:

Search string	Comments

Fro?	Matches Frog, From, Front, etc.

[mh]oney	Matches Money, money, Honey, honey, etc.

[a]*e	Matches Ape, ape, Apple, apple, etc.

[!r]ind	Matches Hind, hind, Mind, mind, but not Rind or rind, etc.

Notes:

Groups of characters may be specified, e.g. [A-G] is the same as [ABCDEFG].

Searches are case insensitive, i.e. "Hat" is the same as "HAT", etc.

No string should begin with a "$" or a "<". If you want the first character of the string you are searching for to be a "$", you must enter "\$", and if you want the first character to be a "<", you must enter "\<".


Unix Style Version Information

If you enter a string that begins with a "$", ugrep will assume that you are searching for Unix style version information. Commonly this information is stored in files in a format like this:

$Header: <filename> v <project id>/<major release>/<minor release>$

for example:

$Header: ugrep.exe v ugrep/001/001$

A typical search string would therefore be, "$Header". This will cause ugrep to look for the first string in the file that begins "$Header", and ends with "$". ugrep will append to each filename where the string was found a tab and the $Header...$ string itself. (Note that regular expression searches are not supported in this mode, and that searches are not case sensitive.)


HTML Titles

If you enter the search string "<title", ugrep will assume that you are searching for HTML titles. HTML titles are encoded as follows:

<TITLE>This is the title text</TITLE>

Thus if you enter the search string, "<title", ugrep will look for the frist string in the file that begins "<title", and ends with "</title". ugrep will append to each filename where the string was found a tab and the Title string excluding the HTML code. (Note that regular expression searches are not supported in this mode, and that searches are not case sensitive.)


ugrep.ini

When you run ugrep for the first time it creates UGREP.INI in your Windows directory. When you run it subsequently it starts up with the defaults it saved the last time it was run.

When you exit ugrep, it automatically saves the state of the check boxes, the current path, and the current file specification in UGREP.INI.

By default ugrep only has one predefined file specification, "*.*". You may add additional ones by editing UGREP.INI with a plain text editor, (like Windows' Notepad), numbering each new entry. Here is the default entry:

1=*.*

You could expand it like this:

1=*.*

2=*.txt;*.ini

3=*.txt;*.bas;*.frm

4=*.bat;*.com;*.exe

5=*.htm


Installation

Copy UGREP.EXE, and optionally UGREP.HLP, (this file), to the same directory on your hard disk. (If you don't already have a copy of THREED.VBX, copy this to \WINDOWS\SYSTEM.)

Start Program Manager and open the group you want to launch ugrep from. Now select File|New to create a new item and use the Browse command to locate UGREP.EXE. ugrep is now ready to run.

Uninstalling

Simply delete the UGREP.EXE and UGREP.HLP files from their directory, delete UGREP.INI from your Windows directory, and delete the icon from the Program Manager group you put ugrep in.


Licence

You are free to use ugrep for as long as you wish free of charge. You may copy ugrep freely and give the copies away.

You may not sell ugrep, nor include it with software which is sold without written permission of the author. If you are a shareware vendor you may charge a small fee for media, copying and postage, but nothing for the software itself. ugrep may not be put on a magazine cover disk without written permission from the author.

The software is not supported, but if you have any problems (or solutions!), the author would be glad to hear from you.

ugrep is copyright © Mark Summerfield 1995: all rights reserved.

Postal Address:	6 Pantygwydr Road, Uplands, Swansea, SA2 OJB, UK.

Email:	msummerf@fdgroup.co.uk

Other utility software by the author of ugrep:

ucopy for Windows, a backup/file and directory mirroring program, with user-definable scripts.

No Blink and No Blink with Date/Time for Windows, programs which give a rock-steady text cursor (caret) in Windows, the latter with a digital clock.

PA for Windows, a multi-purpose utility program.

Tactix for Windows, a game.